package com.sander.guardmanagement.base;


import android.os.Looper;
import android.os.Message;

/**
 * Created by sander on 2017/4/7.
 */

public class UIHandler extends android.os.Handler {
    private IHandler handler ;
    public UIHandler(Looper looper) {
        super(looper);
    }

    public UIHandler(Looper looper,IHandler handler) {
        super(looper);
        this.handler = handler;
    }

    public void setHandler(IHandler handler) {
        this.handler = handler;
    }

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        if (handler != null) {
            handler.handleMessage(msg);//有消息，就传递
        }
    }
}

